package com.tienon.message.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

import javax.annotation.Resource;

import org.junit.Test;


import com.tienon.message.entity.Push_App;

import com.tienon.message.service.LoadSendMsgService;

public class TestLoadAppSendMsg extends UnitTestEnv{

	@Resource
	private LoadSendMsgService service;
	
	@Test
	public void testLoadSingleData() throws InterruptedException, ExecutionException{
		
		//System.out.println(service);
		Push_App data = new Push_App();
		Future<Boolean> r = service.loadAppSendMsgTask(data);
		System.out.println(r.get());
		
	}
	@Test
	public void testLoadMultiData() throws InterruptedException, ExecutionException{
		List<Push_App> datas = new ArrayList<Push_App>();
		for(int i= 0 ;i <10;i++){
			datas.add(new Push_App());
		}
		List<Future<Boolean>> rs = service.loadAppSendMsgTasks(datas);
		
		for(Future<Boolean> r : rs){
			System.out.println(r.get());
		}
		
	}
	
}
